﻿define([
	'../libs/zepto',
	'../common/base',
	'../common/common_click',
	'../common/dialog',
	'../common/yingSoftPrg',
	'../common/yingSoftCookie',
	'../common/ajax',
	'../common/storage'
], function() {
	var freeTry = G_Prg.getCookie('freeTry');
	var m1 = Number(G_Prg.getQueryString('type'));
	var whole_height;
	var _isGetTime = 0;
	if(m1) {
		whole_height = m1;
	} else {
		whole_height = window.innerHeight;
	}
	G_Prg.setCookie('first', '1');

	this.init = function() {
		setCss() // 设置样式 

		$('.time_list').eq(0).click(function() {
			window.location.href = '/exam-time';
		});

		// input的聚焦失焦事件
		$('.ser_img').click(function() {
			var value = $('.text').val();
			if(value == '') {
				G_Prg.alert('搜索内容不能为空');
			} else {
				window.location.href = '/searchExam?fromUrl=doExam-index&keyWord=' + value;
			}
		});

		$('.dayqian span').click(function() {
			if(freeTry == 'true'){
				var yesCallback = function () {
	                parent.location.href = '/login?fromUrl=doExam-index&type=free';
	            }
	            G_Prg.confirm('该功能登录后才能使用！', yesCallback);
	            return;
			}else{
				if($('.dayqian span').html() == '已签到') {
					G_Prg.popMsg('已签到');
					$('#popMsgDiv').css({'margin-left':'-90px','bottom':'200px','background':'#989898'});
					return;
				}
				var params = {
					guid: G_Cookie.getGuid(),
					cli: 1
				}
				var url = '/api/community/userscore/signin?appid='+G_Cookie.getAppID();
				var success = function(json) {
					var jsonData = JSON.parse(json);
					if(jsonData.status === 200) {
						$('.dayqian span').html('已签到');
						$('.dayqian span').addClass('signed');
					} else {
						G_Prg.alert(JSON.stringify(jsonData.msg));
					}
				};
				G_AjaxApiShequ.post(url, params, true, success);
			}

		});

		// 做题
		$('.ullist li').eq(0).click(function() {
			window.location.href = '/doExam-index';
		});
		// 发现
		$('.ullist li').eq(2).click(function() {
			if(!userID) {
				var yesCallback = function() {
					parent.location.href = '/login?fromUrl=doExam-index';
				}
				G_Prg.confirm('该功能登录后才能使用！', yesCallback);
				return;
			}
			window.location.href = '/find';
		});
		// 我的
		$('.ullist li').eq(3).click(function() {
			if(freeTry == 'true') {
				var yesCallback = function() {
					parent.location.href = '/login?fromUrl=doExam-index&type=free';
				}
				G_Prg.confirm('该功能登录后才能使用！', yesCallback);
				return;
			} else {
				if(!userID) {
					var yesCallback = function() {
						parent.location.href = '/login?fromUrl=doExam-index';
					}
					G_Prg.confirm('该功能登录后才能使用！', yesCallback);
					return;
				}
				window.location.href = '/userHome';
			}
		});
		// 巩固
		$('.ullist li').eq(1).click(function() {
			if(freeTry == 'true') {
				var yesCallback = function() {
					parent.location.href = '/login?fromUrl=doExam-index&type=free';
				}
				G_Prg.confirm('该功能登录后才能使用！', yesCallback);
				return;
			} else {
				if(!userID) {
					var yesCallback = function() {
						parent.location.href = '/login?fromUrl=doExam-index';
					}
					G_Prg.confirm('该功能登录后才能使用！', yesCallback);
					return;
				}
				window.location.href = '/Nurse';
			}
		});

	}

	// 设置样式
	function setCss() {
		var head_height = $('.header').height();
		var foot_height = $('.footer').height();
		$('.footer').css('top', whole_height - foot_height);
		var contain_height = whole_height - head_height - foot_height;
		$('.index-containt').css('height', contain_height);
		var s1 =  '<div class="search"><div class="sear">'+
				'<div class="ser_img"><img src="/images/searchb.png" /></div>'+ 
				'<input type="text" placeholder="请输入试题关键字" class="text ser"/></div></div>';
		$('.index-containt').append(s1);
		var index_height = contain_height - $('.search').height();
		var s2 = '<div class="index"></div>';
		$('.index-containt').append(s2);
		// 首页
		$('.index').css('height', index_height);

		// 继续上次学习
		var study = '<div class="continueStudy"></div>'
		$('.index').append(study);
		var study1 =  '<img src="/images/beijing.png" class="bg_index"/>'+
				'<div class="study_content"><div class="right_content">'+
				'<div class="jincheng"><span>上次"章节练习"答题进行了35%</span>'+
				'<b>继续</b></div></div><div class="log_r"><img src="/images/yindaoren.png" /></div></div>';
		$('.continueStudy').html(study1);
		
		_continueStudyClick();
		// 创建时间
		var timeStr = '<ul class="distance_time"></ul>';
		$('.index').append(timeStr);
		$('.distance_time').css('height', index_height * 0.13);
		var str1 = '<li class="time_list"><dl class="tab"><dt><img src="/images/rili.png"/></dt>'+
				'<dd>距离考试还剩<span class="time">18</span>天</dd></dl></li>'+
				'<li class="dayqian"><span></span></li>';
		$('.distance_time').html(str1);
		var time_height = $('.tab dd').height();
		$('.tab').eq(0).find('dd').css('line-height',(time_height) + 'px');
		// bannner
		sign_state();
		var banner = '<div class="guanggao"><img src="/images/tz.png"/><div><span>通知：</span>'+
			'<ul class="lunbo"><li>新版考试宝典上线啦！<li>答疑聊天室上线啦！<li>公众号求关注！</ul></div></div>';
		$('.index').append(banner);
		var lun_height = $('.guanggao div').height();
		$('.guanggao div').css('line-height',lun_height+'px');
		$('.lunbo li').css('line-height',(lun_height+2)+'px');
		var m = 0;
		setInterval(function(){
			m ++;
			if(m > $('.lunbo li').length-1){
				m = 0;
			}
			$('.lunbo').css({
				'top':-(m*lun_height)+'px'
			});
//			$('.lunbo').animate({
//				opacity:0.25,
//      		top:'50px',
//      		color:'#abcdef',
//      		rotateZ:'45deg',
//      		translate3d:'0,10px,0'
//  
//  
//			},50,'ease-out');
		},5000);

		_showExamTime();
		setModule(); // 展示四个模块
	}

	// 继续上次学习
	function _continueStudyClick() {
		var testJson;
		if(G_Storage.checkLocalStorageSupport()) {
			testJson = G_Storage.getLocalStorageValue(G_Cookie.getUserID() + '_' + G_Cookie.getAppEName() + '_testJson');
		} else if(G_Storage.checkSessionStorageSupport()) {
			testJson = G_Storage.getSessionStorageValue(G_Cookie.getUserID() + '_' + G_Cookie.getAppEName() + '_testJson');
		}
		if(testJson) {
			var title = '';
			if(testJson.title){
				if(testJson.title.indexOf('(')){
					var p = /\(.*?\)/g;
	    			title = testJson.title.replace(p,'');
				}else{
					title = testJson.title;
				}
				$('.jincheng span').html('上次"'+ title +'"答到第' + testJson.curTestNO +'题');
				
				var jin_height = $('.jincheng').height();
				if($('.jincheng span').html().length >= 16){
					var content = $('.jincheng span').html();
					var str = content.substring(0,16)+'<br/>'+content.substring(16,content.length);
					var html = '<marquee behavior="scroll" contenteditable="true" scrollamount="3">'+ content +'</marquee>'; 
					$('.jincheng span').css('padding-left','2px');
					$('.jincheng span').html(html);
					$('.jincheng').css('line-height',jin_height + 'px');
				}else{
					$('.jincheng').css('line-height',jin_height + 'px');
				}
				
				$('.jincheng').click(function(){
					window.location.href = '/answerExam?replay=1';
				}); 
		    }else{
				$('.jincheng span').html('暂未答题，快去答题吧！');
				var jin_height = $('.jincheng').height();
				$('.jincheng').css('line-height',jin_height + 'px');
				$('.jincheng span').css('color','#999');
				$('.jincheng b').css('display','none');
			}
		}else{
			$('.jincheng span').html('暂未答题，快去答题吧！');
			var jin_height = $('.jincheng').height();
			$('.jincheng').css('line-height',jin_height + 'px');
			$('.jincheng span').css('color','#999');
			$('.jincheng b').css('display','none');
		}		
	}


	function sign_state() {
		
		var url = '/api/community/userscore/state?guid=' + G_Cookie.getGuid() + '&cli=1';
		var success = function(json) {
			var jsonData = JSON.parse(json);
			if(jsonData.status === 200) {
				
				//G_Prg.$('span_rule').innerHTML = jsonData.data.score;
				if(!jsonData.data.state) {
					$('.dayqian span').html('签到');
				} else {
					$('.dayqian span').html('已签到');
					$('.dayqian span').addClass('signed');
				}
			} else {
				var yesCallback = function () {
	                window.location.href = '/login';
	            }
	            G_Prg.confirm('程序运行错误: 未知返回值：' + JSON.stringify(jsonData), yesCallback);

			}
		};
		G_AjaxApiShequ.get(url, true, success);
	}

	// 创建首页的四个模块
	function setModule() {
		var contain_height = whole_height - $('.header').height() - $('.footer').height();
		var index_height = contain_height - $('.search').height();
		var moduleStr = '<div class="four_module"></div>';
		$('.index').append(moduleStr);
		$('.four_module').css('height', index_height * 0.56);
		var str3 = '<div class="main_position"><dl class="content_dllist">' +
			'<dt><img src="/images/read.png" alt=""+/></dt><dd><h4>章节练习</h4></dd></dl></div>';
		$('.four_module').append(str3);
		var str2 = '<div class="main_position"><dl class="content_dllist">' +
			'<dt><img src="/images/edit.png" alt=""/></dt><dd><h4>智能练习</h4></dd></dl></div>';
		$('.four_module').append(str2);
		var str4 = '<div class="main_position mnks"><dl class="content_dllist">' +
			'<dt><img src="/images/simulation.png" alt=""/></dt><dd><h4>模拟考试</h4></dd></dl></div>';
		$('.four_module').append(str4);
		
		var str5 = '<div class="main_position ytmj"><img src="/images/choubei.png" class="choubei"/><dl class="content_dllist">'+
				'<dt><img src="/images/ytmj.png" alt=""/></dt><dd><h4>押题密卷</h4></dd></dl></div>';
				
		
		var str6 = '<div class="main_position zdkd"><img src="/images/choubei.png" class="choubei"/><dl class="content_dllist">'+
				'<dt><img src="/images/explain.png" alt=""/></dt><dd><h4>重点考点</h4></dd></dl></div>';
		var yatiResult = _ytTestTitle();
		var _appEName = G_Cookie.getAppEName();
		if(yatiResult === 1){
			$('.four_module').append(str5);
			$('.four_module').append(str6);
			$('.choubei').attr('src','/images/new1.png');
        }
		var str7 = '<div class="main_position kdsl"><dl class="content_dllist">'+
				'<dt><img src="/images/kdsl.png" alt=""/></dt><dd><h4>考点梳理</h4></dd></dl></div>';
				
		if(_appEName in zsbk_appENameArr){
			$('.four_module').append(str7);
		}
		var str8 = '<div class="main_position kdjj"><dl class="content_dllist">'+
				'<dt><img src="/images/kdsl.png" alt=""/></dt><dd><h4>考点精讲</h4></dd></dl></div>';			
		
		if(_appEName in zsbk_gotokdjj){
			$('.four_module').append(str8);
		}
		var str9 = '<div class="main_position rank"><dl class="content_dllist">'+
			'<dt><img src="/images/rank-index.png" alt=""/></dt><dd><h4>排行榜</h4></dd></dl></div>';
		$('.four_module').append(str9);
		//考点精讲===============================================
		if(_appEName == 'ZY_HS'){
			$('.kdjj').css('display','block');
			$('.choubei3').attr('src', '/images/new1.png');
		}else if(_appEName=='ZY_ZYI'){
			
			$('.kdjj').css('display','block');
			$('.choubei2').attr('src', '/images/new1.png');
		}else {
			$('.kdjj').css('display','none');
			$('.choubei2').attr('src', '/images/choubei.png');
		}
		//考点梳理===================================================
		if(_appEName in zsbk_appENameArr) {
			$('.kdsl').css('display','block');
			$('.choubei2').attr('src', '/images/new1.png');

		} else {
			$('.kdsl').css('display','none');
			$('.choubei2').attr('src', '/images/choubei.png');
		}
		
		
		
		// 点击事件
		_clickEvent();
	}

	var appENameArr2 = {
		'JC_YJXFGCS_YTB': true,
		'ZC_FS_YTMJ': true,
		'ZC_KQ_YTMJ': true,
		'ZC_MZ_YTMJ': true,
		'ZC_KFYX_YTMJ': true,
		'ZC_HYX_YTMJ': true,
		'ZC_BLX_YTMJ': true,
		'ZC_LCYXJYX_YTMJ': true,
		'ZC_CSBYX_YTMJ': true,
		'ZC_ZLNKX_YTMJ': true,
		'ZC_ZLWKX_YTMJ': true,
		'ZC_ZLFSZLX_YTMJ': true,
		'ZC_JS_YTMJ': true,
		'ZC_ZY_YTMJ': true,
		'ZC_ZYFK_YTMJ': true,
		'ZC_ZYNK_YTMJ': true,
		'ZC_ZXYJHNKX_YTMJ': true,
		'ZC_ZYEK_YTMJ': true,
		'ZC_ZYZJ_YTMJ': true,
		'ZC_TNAM_YTMJ': true,
		'ZC_ZYPFXB_YTMJ': true,
		'ZC_ZYGSK_YTMJ': true,
		'ZC_ZYWK_YTMJ': true,
		'ZC_ZYGCK_YTMJ': true,
		'ZC_ZYYK_YTMJ': true,
		'ZC_ZYEBHK_YTMJ': true,
		'ZC_FYBJ_YTMJ': true,
		'ZC_JKJY_YTMJ': true,
		'ZC_ZXYJHWK_YTMJ': true,
		'ZC_ZXYJHGSK_YTMJ': true,
		'ZC_KQNK_YTMJ': true,
		'ZC_KQZJ_YTMJ': true,
		'ZC_KQXF_YTMJ': true,
		'ZC_KQHMWK_YTMJ': true,
		'ZC_TTX_YTMJ': true,
		'ZC_ZZYX_YTMJ': true,
		'ZC_GGWS_YTMJ': true,
		'ZC_JBKZ_YTMJ': true,
		'ZC_ZYBS_YTMJ': true,
		'ZC_NK_YTMJ': true,
		'ZC_QK_YTMJ': true,
		'ZC_HXNK_YTMJ': true,
		'ZC_NFM_YTMJ': true,
		'ZC_SJNK_YTMJ': true,
		'ZC_SNK_YTMJ': true,
		'ZC_XHNK_YTMJ': true,
		'ZC_XXGNK_YTMJ': true,
		'ZC_XYB_YTMJ': true,
		'ZC_WK_YTMJ': true,
		'ZC_GWK_YTMJ': true,
		'ZC_MNWK_YTMJ': true,
		'ZC_SJWK_YTMJ': true,
		'ZC_XRWK_YTMJ': true,
		'ZC_XXWK_YTMJ': true,
		'ZC_CRBX_YTMJ': true,
		'ZC_FSYLCMYX_YTMJ': true,
		'ZC_JHB_YTMJ': true,
		'ZC_ZYB_YTMJ': true,
		'ZC_FC_YTMJ': true,
		'ZC_EK_YTMJ': true,
		'ZC_YK_YTMJ': true,
		'ZC_EBYHK_YTMJ': true,
		'ZC_JSBX_YTMJ': true,
		'ZC_PFXBX_YTMJ': true,
		'ZC_SSWK_YTMJ': true,
		'ZC_ZXWK_YTMJ': true
	}
	var zsbk_appENameArr = { //显示考点梳理
		//20160822添加到newt上面的
//		'ZY_HS': true, //执业护士
		//20160826添加到newt上面的
		'ZC_YS_YTMJ': true, //2017年药学职称考试宝典（主管药师）押题密卷
		'ZC_YJS_YTMJ': true, // 2017年药学职称考试宝典（药剂师）押题密卷
		'ZC_YJSHI_YTMJ': true, //2017年药学职称考试宝典（药剂士）押题密卷
		//'ZC_ZGHSWKHL': true,
		'ZY_ZYI': true, //中医执业医师
		'GJZC_ZYX': true, //医学高级(中药学)
		'ZC_ZGHSNKHL_YTMJ': true, //主管护师（内科护理）押题密卷
		'ZC_ZGHSWKHL_YTMJ': true, //主管护师（外科护理）押题密卷
		'ZC_ZGHSEKHL_YTMJ': true, //主管护师（儿科护理）押题密卷
		'ZC_ZGHSFKHL_YTMJ': true, //主管护师（妇产科护理）押题密卷
		'ZC_ZGHSSQHL_YTMJ': true, //主管护师（社区护理）押题密卷
		'ZC_ZGHS_YTMJ': true, //主管护师（护理学）押题密卷
		'ZY_XY_YTMJ': true, //执业药师（西药）押题密卷
		'ZY_ZYAO_YTMJ': true, //执业药师（中药）押题密卷
		'ZY_LCZY_YTMJ': true, //临床执业医师押题密卷
		'ZY_LCZL_YTMJ': true, //临床执业助理医师押题密卷
		'ZY_KQZY_YTMJ': true, //口腔执业医师押题密卷
		'ZY_KQZL_YTMJ': true, //口腔执业助理医师押题密卷
		'ZY_ZYZY_YTMJ': true, //中医执业医师押题密卷
		'ZY_ZYZL_YTMJ': true, //中医执业助理医师押题密卷
		'ZY_ZXYZY_YTMJ': true, //中西医结合执业医师押题密卷
		'ZY_ZXYZL_YTMJ': true, //中西医结合执业助理医师押题密卷
		'ZY_GWZY_YTMJ': true //公卫执业医师押题密卷
	}
	var zsbk_gotokdjj = {//考点精讲
		'ZY_ZYI': true,
		'GJZC_ZYX': true,
		'GJZC_ZG_ZYX': true,
		'ZY_HS': true
	}
	function _clickEvent() {
		//章节练习
		$('.main_position').eq(0).click(function(){
			window.location.href = '/chapterExam';
		});
		
		$('.main_position').eq(1).click(function(){
			var userID = G_Cookie.getUserID();
			if(freeTry == 'true'){
				console.log(freeTry)
				var yesCallback = function () {
	                parent.location.href = '/login?fromUrl=doExam-index&type=free';
	            }
	            G_Prg.confirm('该功能登录后才能使用！', yesCallback);
	            return;
			}else{
				_mockExamClick();
				if(userID && G_Prg.checkVipApp()){
					window.location.href = 'answerExam?fromUrl=doExam-index&count=15&wrongFirst=0&newFirst=0';
				}
			}
		});
		
		$('.main_position').eq(2).click(function(){
			var userID = G_Cookie.getUserID();
			console.log(freeTry)
			if(freeTry == 'true'){
				var yesCallback = function () {
	                parent.location.href = '/login?fromUrl=doExam-index&type=free';
	            }
	            G_Prg.confirm('该功能登录后才能使用！', yesCallback);
	            return;
			}else{
				_mockExamClick()
				if(userID && G_Prg.checkVipApp()){
					parent.location.href = window.location.href = '/mockExam';
				}
			}
		});
		//模拟考试
		$('.ytmj').click(function(){
			var userID = G_Cookie.getUserID();
			var _appEName = G_Cookie.getAppEName();
			if(freeTry == 'true'){
				var yesCallback = function () {
	                window.location.href = '/login?fromUrl=doExam-index&type=free';
	           	}
				G_Prg.confirm('该功能登录后才能使用！', yesCallback);
			}else{
				var yatiResult = _ytTestTitle();
				
				console.log(_appEName)
				if(yatiResult === 1){
						window.location.href = '/ytmj';
		        }else{
		        	G_Prg.alert('功能正在拼命筹备中，敬请期待！');
		        }
			}
		});
		
		$('.zdkd').click(function(){
			var userID = G_Cookie.getUserID();
			var _appEName = G_Cookie.getAppEName();
			if(freeTry == 'true'){
				var yesCallback = function () {
	                window.location.href = '/login?fromUrl=doExam-index&type=free';
	           	}
				G_Prg.confirm('该功能登录后才能使用！', yesCallback);
			}else{
				var yatiResult = _ytTestTitle();
				
				if(yatiResult === 1){
//		        	if(_appEName in appENameArr2){
		        		window.location.href = '/kdzd';
//		        	}else{
//		        		G_Prg.alert('重点考点内容将于考前半个月陆续更新，敬请期待！');
//		        	}
		        }else{
		        	G_Prg.alert('重点考点内容将于考前半个月陆续更新，敬请期待！');
		        }
			}
		});
		$('.kdsl').click(function(){
			var userID = G_Cookie.getUserID();
			var userID = G_Cookie.getUserID();
			var _appEName = G_Cookie.getAppEName();
			console.log('a')
			if(freeTry == 'true') {
				var yesCallback = function() {
					window.location.href = '/login?fromUrl=doExam-index&type=free';
				}
				G_Prg.confirm('该功能登录后才能使用！', yesCallback);
			} else {
				if(_appEName in zsbk_appENameArr) {
					window.location.href = '/materialList';
				} 
//				else {
//					G_Prg.alert('功能正在拼命筹备中，敬请期待！');
//				}
			}
		})

		$('.kdjj').click(function(){
			var userID = G_Cookie.getUserID();
			if(freeTry == 'true'){
				var yesCallback = function () {
	                window.location.href = '/login?fromUrl=doExam-index&type=free';
	           	}
				G_Prg.confirm('该功能登录后才能使用！', yesCallback);
			}else{
				window.location.href = '/TestingCentre';
			}
		}) 
		//排行榜
		$('.rank').click(function(){
			window.location.href = '/rankList';
		});
	}
		

	// 检测当前科目是否有押题密卷
	function _ytTestTitle() {
		var appID = G_Cookie.getAppID();
		if(!appID) {
			G_Prg.confirm('程序运行错误，defaultPage._ytTestTitle ,不能处理appID=' + appID,function(){
				window.location.href = '/switchMenu'
			});

		}
		var result = '';
		var URL = '/api/app/getAppInfo?appID=' + appID;
		var success = function(json) {
			var jsonData = JSON.parse(json);
			if(jsonData.status === 200) {
				result = jsonData.data.hasSecretPaper;
			} else if(jsonData.status === 201) {
				result = '';
			} else {}
		};
		G_AjaxApi_Record.get(URL, false, success);
		return result;
	}

	function _mockExamClick() {
		var userID = G_Cookie.getUserID();
		if(!userID) {
			var yesCallback = function() {
				parent.location.href = '/login?fromUrl=doExam-index';
			}
			G_Prg.confirm('该功能登录后才能使用！', yesCallback);
			return;
		}
		if(!G_Prg.checkVipApp()) {
			G_Prg.confirm('该功能充值后才能使用！', function() {
				window.location.href = '/recharge'
			});
			return;
		}
	}

	// 获取距离考试的时间
	function _showExamTime() {
		// var _userID = G_Cookie.getUserID();
		//  		if (!_userID) {//未登录
		//           return;
		//       }
		//       if (_isGetTime) {
		//           return;
		//       }
		var userName = G_Cookie.getUserName(); // 手机号
		var guid = G_Cookie.getGuid();
		var _time = 0;
		//异步取考试时间
		var callBack = function(examTime) {
			if(examTime) {
				_time = Math.ceil((new Date(examTime).valueOf() - new Date().valueOf()) / (24 * 60 * 60 * 1000));
				if(_time < 0) {
					_time = 0;
				}
			}
			$('#loadingDiv').css('display', 'none');
			$('.time').html(_time); //考试时间设置
		}
		var appID = G_Cookie.getAppID();
		var userID = G_Cookie.getUserID();
		_getExamTime(userID, appID, guid, userName, callBack)
	}

	function _getExamTime(userID, appID, guid, userName, callBack) {
        // _isGetTime = 1;
        var URL = '/api/examTime/getExamTimeData?appID=' + appID + '&guid=' + guid;
        var examTime = '';
        G_AjaxApi_Record.get(URL, true, function (json) {
            var jsonData = JSON.parse(json);
				if(jsonData.status === 200) {
					if(jsonData.data.examBeginTime) {
						examTime = jsonData.data.examBeginTime;
					} else {
						examTime = jsonData.data.examTime;
					}
					callBack(examTime);
				} else if(jsonData.status === 201) {
					if(jsonData.examBeginTime) {
						examTime = jsonData.examBeginTime;
						callBack(examTime);
					}
				} else if(jsonData.status === 300) {
					G_Prg.confirm('程序运行错误:_getExamTime,参数错误',function(){
						window.location.href = '/login'
					});

				} else if(jsonData.status >= 400 && jsonData.status < 500) {
					G_Prg.confirm('程序运行错误:_getExamTime,参数错误',function(){
						window.location.href = '/login'
					});

				} else {
					G_Prg.confirm('程序运行错误:_getExamTime,参数错误',function(){
						window.location.href = '/login'
					});

				}
        });
    }


	init();
});